package com.yanxiaohui.controller;

import com.yanxiaohui.order.service.OrderService;
import com.yanxiaohui.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author： yanxh<br>
 * @Date 2019/11/12 16:25<br>
 * @Version 1.0<br>
 */
@RestController
public class TestController {

    @Autowired
    private OrderService orderService;

    @Autowired
    private UserService userService;

    @RequestMapping("/addOrder")
    public String addOrder(String name){
        return orderService.addOrder(name) > 0 ? "success" : "fail";
    }

    @RequestMapping("/addUser")
    public String addUser(String name){
        return userService.addUser(name) > 0 ? "success" : "fail";
    }
}
